<div class="fsh-rightPanel">
    <div class="layui-anim layui-anim-upbit">
        <div class="layui-form-item wx-search" id="list_form">
            <div class="layui-inline">
                <input type="text" name="inputcode" placeholder="请输入昵称" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-inline">
                <input type="text" name="inputcode" placeholder="完成状态" autocomplete="off" class="layui-input">
            </div>
            <button class="layui-btn btn-primary" id="search">搜索</button>
        </div>
        <table id="list_table" class="layui-hide" lay-filter="mainList"></table>
    </div>
</div>

<script>
    layui.use(['layer', 'table'], function () {
        var layer = layui.layer;
        var table = layui.table;
        var baseCode = getHashParam().baseCode;

        var tableObj = table.render({
            id: 'list_table',
            elem: '#list_table',
            url: '/zhuli/send/list',
            align: "center",
            where: {baseCode: baseCode},
            cols: [[ //表头
                {type: 'checkbox'},
                {field: 'baseCode', title: '活动编码', width: 100, align: 'center',},
                {field: 'sendNickname', title: '发起人', width: 200, align: 'center',},
                {field: 'sendTime', title: '发起时间', width: 170, align: 'center',},
                {
                    field: 'sendStatus', title: '状态', width: 150, align: 'center', templet: function (d) {
                        return d.baseStatus == 0 ? '进行中' : '已完成';
                    }
                },
                {field: 'sendQrcode', title: '海报二维码', width: 150, align: 'center',},
                {field: 'sendQrcode', title: '参与人数', width: 150, align: 'center',},
                {
                    field: 'lock', title: '操作', width: 300, align: 'center', templet: function (d) {
                        return '<a class="font-primary2" lay-event="detail" href="javascript:;">详情</a>';
                    }, unresize: true, align: 'center'
                }
            ]],
        });

        $("#search").click(function () {
            reloadTable(tableObj);
        });

        //表格内部操作按钮监听
        table.on('tool(mainList)', function (obj) {
            var data = obj.data;
            var layEvent = obj.event;
            //显示粉丝
            if (layEvent === 'detail') {
                showDialog({
                    title: '助力列表',
                    template: 'detail',
                    height: 500,
                    width:750,
                    htmlData: data,
                    btn: ['关闭'],
                    yes: function (index, layero) {
                        layer.close(index);
                    }
                });
            }
        });
    });
</script>
